﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using Adex;
using MediaMonitor.Common;

namespace MediaMonitor
{


    public partial class DefaultMaster : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
               // FillCountries();

            }
        }

        private void FillCountries()
        {
            DataTable dt = Adex.Country.Query().WHERE("Active", 1).ExecuteDataSet().Tables[0];
           // this.rptCountries.DataSource = dt; 
            //this.rptCountries.DataBind();
            
        }

        //protected void lnkCountry_Clicked(object sender, EventArgs e)
        //{
        //    byte countryId = Utility.ToByte(((LinkButton)(sender)).CommandArgument);
        //    //string countryName = Utility.ToStr(Adex.Country.Query().SetSelectList("CountryName").WHERE("CountryId", countryId).ExecuteScalar());
        //    //AppUser.SetCountry(countryId, countryName);
        //    //Response.Redirect(Request.RawUrl);

        //    string url2redirect = Utility.AppPath;

        //    if (countryId == 58)
        //        url2redirect = System.Configuration.ConfigurationManager.AppSettings["MM_DO_URL"].ToString();

        //    if (countryId == 177)
        //        url2redirect = System.Configuration.ConfigurationManager.AppSettings["MM_PR_URL"].ToString(); ;

        //    if (countryId == 218)
        //        url2redirect = System.Configuration.ConfigurationManager.AppSettings["MM_TT_URL"].ToString(); ;

        //    if (countryId == 231)
        //        url2redirect = System.Configuration.ConfigurationManager.AppSettings["MM_VE_URL"].ToString(); ;


        //    Response.Redirect(url2redirect);
        //}
    }

}